﻿<script id="messagesTmpl" type="text/x-jquery-tmpl">
<table class="messages" anchor="new"{{if has_next}} has_next="true"{{/if}}{{if has_prev}} has_prev="true"{{/if}}>
  <tbody>
    {{tmpl(messages, { targetBlank: targetBlank, hideCheckboxes: hideCheckboxes, showFolders: showFolders, htmlEncode : $item.htmlEncode, getTagsToDisplay: $item.getTagsToDisplay, getCountTagsInMore: $item.getCountTagsInMore}) "messageItemTmpl"}}
  </tbody>
</table>
</script>

<script id="messageItemTmpl" type="text/x-jquery-tmpl">
    <tr data_id="${id}" date="${date}" chain_date="${chainDate}" class="row{{if isNew}} new{{/if}}"{{if restoreFolderId}} PrevFolderId="${restoreFolderId}"{{/if}}>
        {{if !$item.hideCheckboxes }}<td class="checkbox"><input type="checkbox" data_id="${id}" title="${ASC.Mail.Resources.MailResource.Select}"/></td>{{/if}}
  <td class="importance"><i class="icon-{{if important!=true}}un{{/if}}important" 
      title="{{if important}}${ASC.Mail.Resources.MailScriptResource.ImportantLabel}{{else}}${ASC.Mail.Resources.MailScriptResource.NotImportantLabel}{{/if}}"></i>
        </td>
        <td class="from">
            <a href="${anchor}" {{if $item.targetBlank}}target="_blank"{{/if}}>
                <span class="author" title="${author!='' ? author : sender}" email="${sender}">
                    {{if author=='' && sender==''}}${ASC.Mail.Resources.MailResource.NoAddress}{{else}}${author!='' ? author : sender}{{/if}}
                </span>
                <span class="chain-counter" value="${chainLength}">{{if chainLength > 1}}(${chainLength}){{/if}}</span>
            </a>
        </td>
        <td class="subject" title="{{if subject==''}}${ASC.Mail.Resources.MailResource.NoSubject}{{else}}${$item.htmlEncode(subject)}{{/if}}">
            <a href="${anchor}" _tags="{{each tagIds}}{{if $index>0}},{{/if}}${$value}{{/each}}" {{if $item.targetBlank}}target="_blank"{{/if}}>
                {{tmpl($item.getTagsToDisplay(tags), { htmlEncode : $item.htmlEncode}) "messageItemTagsTmpl"}}
                {{tmpl($item.getCountTagsInMore(tags)) "messageItemTagsMoreTmpl"}}
                <span class="subject-text">{{if subject==''}}${ASC.Mail.Resources.MailResource.NoSubject}{{else}}${$item.htmlEncode(subject)}{{/if}}</span>
            </a>
        </td>
        {{if $item.showFolders}}
        <td class="folder"><a href="${anchor}" {{if $item.targetBlank}}target="_blank"{{/if}}>${folderName}</a></td>
        {{/if}}
        <td class="attachment"><a href="${anchor}" {{if $item.targetBlank}}target="_blank"{{/if}}>{{if hasAttachments==true}}<i class="{{if calendarUid != null && calendarUid != ''}}icon-calendar{{else}}icon-attachment{{/if}}"></i>{{/if}}</a></td>
        <td class="date"><a href="${anchor}" {{if $item.targetBlank}}target="_blank"{{/if}}>{{if isToday}}${ASC.Mail.Resources.MailResource.TodayLabel}{{else isYesterday}}${ASC.Mail.Resources.MailResource.YesterdayLabel}{{else}}${displayDate}{{/if}}</a></td>
        <td class="time"><a href="${anchor}" {{if $item.targetBlank}}target="_blank"{{/if}}>${displayTime}</a></td>
    </tr>
</script>

<script id="messageItemTagsTmpl" type="text/x-jquery-tmpl">
  <span labelid="${id}" class="tag tagArrow tag${style}" title="${$item.htmlEncode(name)}">${$item.htmlEncode(short_name)}</span>
</script>

<script id="messageItemTagsMoreTmpl" type="text/x-jquery-tmpl">
  {{if $data > 0}}<span class="more-tags link dotted">${ASC.Mail.Resources.MailScriptResource.More.replace('%1', $data)}</span>{{/if}}
</script>